# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-unidecode
_pkgname=Unidecode
pkgver=1.1.1
pkgrel=4
pkgdesc='ASCII transliterations of Unicode text.'
url='https://pypi.org/project/unidecode/#files'
arch=('any')
license=('GPL')
depends=('python2')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('5474f04be843ed94ddceb1a7e5f1ca986ee5f2e88ee35bd9347784c7a11b51e1d94d61e1a2a10dd2e71b3587c5b7b76717756f6cf4e2446d83222178c2360696')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/unidecode" "$pkgdir/usr/bin/unidecode2"
}

